package com.xitang.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xitang.common.bean.BizMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BizMaterialMapper extends BaseMapper<BizMaterial> {
    @Select("select m.* from biz_product_material pm, biz_material m where pm.product_code = #{product_code} and pm.material_code = m.material_code")
    List<BizMaterial> returnMaterials(@Param("product_code") String productCode);

    List<BizMaterial> selectDataByCustom(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize, @Param("materialCode") String materialCode, @Param("materialName") String materialName);

    Long selectCountByCustom(@Param("materialCode") String materialCode, @Param("materialName") String materialName);
}